package com.tc.zigbee.mt.income;

import java.util.LinkedList;
import java.util.List;

import com.tc.util.DataUtil;

public class IeeeResponse extends IncomeMessage{
	public IeeeResponse(byte[] data){
		status = data[0];
		ieeeAddress = new byte[8];
		for(int i = 0; i < 8; i++)
			ieeeAddress[i] = data[i + 1];
		byte[] na = new byte[2];
		na[0] = data[9];
		na[1] = data[10];
		nwkAddress = DataUtil.shortValue(na);
		startIndex = data[11];
		assocLength = data[12];
		for(int i = 0; i < assocLength; i++){
			na[0] = data[13 + i * 2];
			na[1] = data[13 + i * 2 + 1];
			assocDevices.add(DataUtil.shortValue(na));
			
		}
		
	}
	byte status;
	byte[] ieeeAddress;
	short nwkAddress;
	byte startIndex;
	byte assocLength;
	public byte[] getIeeeAddress() {
		return ieeeAddress;
	}
	public byte getStatus() {
		return status;
	}
	public short getNwkAddress() {
		return nwkAddress;
	}
	public byte getStartIndex() {
		return startIndex;
	}
	public List<Short> getAssocDevices() {
		return assocDevices;
	}
	List<Short> assocDevices = new LinkedList<Short>();
}
